package com.sjh.baseui.pop

import android.content.Context
import android.view.Gravity
import android.view.View
import android.view.animation.Animation
import android.view.animation.TranslateAnimation
import razerdp.basepopup.BasePopupWindow
/**
 * 底部基础弹窗
 * @author ysj
 * @date 2020/7/30 14:15
 */
abstract class BaseBottomPopup(context: Context) :BasePopupWindow(context) {

    init {
        popupGravity = Gravity.BOTTOM
    }

    override fun onCreateContentView(): View {
        return createPopupById(getViews())
    }

    override fun onCreateShowAnimation(): Animation {
        val showAnimation = TranslateAnimation(0f, 0f, 1000f, 0f)
        showAnimation.duration = 300
        return showAnimation
    }

    override fun onCreateDismissAnimation(): Animation {
        val disAnimation = TranslateAnimation(0f, 0f, 0f, 1000f)
        disAnimation.duration = 300
        return disAnimation
    }

    abstract fun getViews():Int


}